<template>
  <div class="app-container">
    <div class="filter-container default-box">
      <el-row type="flex" align="middle">
        <el-col :span="21">
          <el-row type="flex" justify="space-between" :gutter="150" class="filter-row">
            <el-col :span="8">
              <span>用户ID：</span>
              <el-input v-model="listQuery.title" placeholder="请输入用户ID" class="filter-item" />
            </el-col>
            <el-col :span="8">
              <span>账号：</span>
              <el-input v-model="listQuery.title" placeholder="请输入账号" class="filter-item" />
            </el-col>
            <el-col :span="8">
              <span>上级账号：</span>
              <el-input v-model="listQuery.title" placeholder="请输入上级账号" class="filter-item" />
            </el-col>
          </el-row>
          <el-row type="flex" justify="space-between" :gutter="150" class="filter-row">
            <el-col :span="8">
              <span>今日签到：</span>
              <el-select v-model="statusvalue" filterable placeholder="请选择">
                <el-option v-for="item in statusoptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-col>
            <el-col :span="8">
              <span>是否VIP：</span>
              <el-select v-model="statusvalue" filterable placeholder="请选择">
                <el-option v-for="item in statusoptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-col>
            <el-col :span="8">
              <span>个人经验：</span>
              <el-select v-model="statusvalue" filterable placeholder="请选择">
                <el-option v-for="item in statusoptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-col>
          </el-row>
          <el-row type="flex" justify="space-between" :gutter="150" class="filter-row">
            <el-col :span="8">
              <span>可用积分：</span>
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
              <i class="el-icon-minus" />
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
            </el-col>
            <el-col :span="8">
              <span>互帮值：</span>
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
              <i class="el-icon-minus" />
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
            </el-col>
            <el-col :span="8">
              <span>账户余额：</span>
              <!-- prefix-icon="el-icon-money" -->
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
              <i class="el-icon-minus" />
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
            </el-col>
          </el-row>
          <el-row type="flex" justify="space-between" :gutter="150" class="filter-row">
            <el-col :span="8">
              <span>直推实名：</span>
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
              <i class="el-icon-minus" />
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
            </el-col>
            <el-col :span="8">
              <span>直推经验：</span>
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
              <i class="el-icon-minus" />
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
            </el-col>
            <el-col :span="8">
              <span>团队经验：</span>
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
              <i class="el-icon-minus" />
              <el-input v-model="listQuery.title" type="number" class="filter-item" />
            </el-col>
          </el-row>
          <el-row type="flex" justify="space-between" :gutter="150" class="filter-row">
            <el-col :span="8">
              <span>经验排序：</span>
              <el-select v-model="statusvalue" filterable placeholder="请选择">
                <el-option v-for="item in statusoptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="3" class="fliter-btn">
          <el-col :span="24" class="filter-row">
            <el-button class="filter-item" type="primary" icon="el-icon-search" round>
              查询
            </el-button>
          </el-col>
          <el-col :span="24" class="filter-row">
            <el-button class="filter-item" icon="el-icon-refresh-right" round>
              重置
            </el-button>
          </el-col>
        </el-col>
      </el-row>
    </div>
    <div class="default-box">
      <div class="filter-container">
        <el-button class="filter-item" type="primary" icon="el-icon-notebook-2" round>
          短信风控
        </el-button>
        <el-button class="filter-item" type="primary" icon="el-icon-notebook-2" round plain>
          日志
        </el-button>
      </div>
      <el-table
        :key="tableKey"
        v-loading="listLoading"
        :data="list"
        fit
        highlight-current-row
        style="width: 100%;"
      >
        <el-table-column label="账号" min-width="200" show-overflow-tooltip>
          <template>
            <span>637967689796710400</span>
          </template>
        </el-table-column>
        <el-table-column label="上级(UID)" width="200">
          <template>
            <span :style="{borderBottom:'1px solid '+$store.state.settings.theme,color:$store.state.settings.theme}">266988</span>
          </template>
        </el-table-column>
        <el-table-column label="昵称" min-width="200" show-overflow-tooltip>
          <template>
            <span>淘粉用户</span>
          </template>
        </el-table-column>
        <el-table-column label="伞下加速" width="150">
          <template>
            <span>100%</span>
          </template>
        </el-table-column>
        <el-table-column label="蜜罐" width="150">
          <template>
            <span>无</span>
          </template>
        </el-table-column>
        <el-table-column label="广告包" width="150">
          <template>
            <span>无</span>
          </template>
        </el-table-column>
        <el-table-column label="可用积分" width="150">
          <template>
            <span>1000.0000</span>
          </template>
        </el-table-column>
        <el-table-column label="可用权益值" width="150">
          <template>
            <span>1000.0000</span>
          </template>
        </el-table-column>
        <el-table-column label="冻结积分" width="150">
          <template>
            <span>1000.0000</span>
          </template>
        </el-table-column>
        <el-table-column label="互帮值" width="150">
          <template>
            <span>1000.0000</span>
          </template>
        </el-table-column>
        <el-table-column label="余额" width="150">
          <template>
            <span>1000.0000</span>
          </template>
        </el-table-column>
        <el-table-column label="本人经验值" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="直推经验值" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="团队经验值" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="小区经验值" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="团队经验值" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="直推人数" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="团队人数" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="直推未实名人数" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="直推实名人数" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="团队实名人数" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="转赠次数" width="150">
          <template>
            <span>1000</span>
          </template>
        </el-table-column>
        <el-table-column label="是否签到" width="150">
          <template>
            <span>未签到</span>
          </template>
        </el-table-column>
        <el-table-column label="签到进度" width="150">
          <template>
            <span>100</span>
          </template>
        </el-table-column>
        <el-table-column label="邀请码" width="150">
          <template>
            <span>THHDKLANGDHN</span>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" width="200" show-overflow-tooltip>
          <template>
            <span>2022-05-01 00:00:00</span>
          </template>
        </el-table-column>
        <el-table-column label="备注" width="150" show-overflow-tooltip>
          <template>
            <span>无效凭证,1.9解封</span>
          </template>
        </el-table-column>
        <el-table-column label="用户状态" width="150">
          <template>
            <el-switch v-model="value1" active-text="禁用" inactive-text="启用" />
          </template>
        </el-table-column>
        <el-table-column label="签到验证码" width="150">
          <template>
            <el-switch v-model="value1" active-text="关闭" inactive-text="启用" />
          </template>
        </el-table-column>
        <el-table-column label="VIP状态" width="200">
          <template>
            <el-switch v-model="value1" active-text="禁用VIP" inactive-text="VIP正常" />
          </template>
        </el-table-column>
        <el-table-column label="释放状态" width="200">
          <template>
            <el-switch v-model="value1" active-text="禁止释放" inactive-text="正常释放" />
          </template>
        </el-table-column>
        <el-table-column label="转赠状态" width="200">
          <template>
            <el-switch v-model="value1" active-text="禁用转赠" inactive-text="正常转赠" />
          </template>
        </el-table-column>
        <el-table-column label="交易状态" width="200">
          <template>
            <el-switch v-model="value1" active-text="禁用交易" inactive-text="正常交易" />
          </template>
        </el-table-column>
        <el-table-column label="锁达人" width="150">
          <template>
            <el-switch v-model="value1" active-text="禁用" inactive-text="启用" />
          </template>
        </el-table-column>
        <el-table-column label="锁手续费" width="150">
          <template>
            <el-switch v-model="value1" active-text="禁用" inactive-text="启用" />
          </template>
        </el-table-column>
        <el-table-column label="转赠短信码" width="150">
          <template>
            <el-switch v-model="value1" active-text="关闭" inactive-text="启用" />
          </template>
        </el-table-column>
        <el-table-column label="广告包挂单短信码" width="150">
          <template>
            <el-switch v-model="value1" active-text="禁用" inactive-text="启用" />
          </template>
        </el-table-column>
        <el-table-column label="操作" min-width="1200" class-name="small-padding fixed-width">
          <template>
            <el-button type="primary" round>
              详情
            </el-button>
            <el-button type="warning" round>
              添加蜜罐
            </el-button>
            <el-button type="primary" round>
              相关记录
            </el-button>
            <el-button type="warning" round>
              开通VIP
            </el-button>
            <el-button type="info" round>
              解绑
            </el-button>
            <el-button type="primary" round>
              设置伞下加速
            </el-button>
            <el-button type="primary" round>
              批量短信
            </el-button>
            <el-button type="primary" round>
              注销
            </el-button>
            <el-button type="primary" round>
              改电话
            </el-button>
            <el-button type="primary" round>
              积分退权益值
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
    </div>
  </div>
</template>

<script>
import { fetchList } from '@/api/article'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
export default {
  name: 'Adminrole',
  components: { Pagination },
  data() {
    return {
      tableKey: 0,
      list: null,
      total: 0,
      listLoading: true,
      listQuery: {
        page: 1,
        limit: 10,
        importance: undefined,
        title: undefined,
        type: undefined,
        sort: '+id'
      },
      statusoptions: [{ // 状态选择项组
        value: '',
        label: '全部'
      }, {
        value: '未完成',
        label: '未完成'
      }, {
        value: '认证通过',
        label: '认证通过'
      }],
      statusvalue: '', // 状态的类型
      value1: false
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      this.listLoading = true
      fetchList(this.listQuery).then(response => {
        this.list = response.data.items
        this.total = response.data.total
        setTimeout(() => {
          this.listLoading = false
        }, 1.5 * 1000)
      })
    }
  }
}
</script>
<style scoped lang="scss">
  [class^=el-icon-], [class*=" el-icon-"]{
    font-size: 16px;
  }
  .small-padding i{
    margin-right: 12px;
  }
  .small-padding i:last-child{
    margin-right: 0px;
  }
  ::v-deep .el-col-8{
    display: flex;
    white-space: nowrap;
    align-items: center;
  }
  ::v-deep .el-select{
    width: 100%;
  }
  .fliter-btn{
    text-align: center;
  }
  .el-icon-minus{
    padding: 0 16px;
  }
  .filter-container{
    .filter-row{
      margin-bottom: 16px;
    }
    span{
    width: 100px;
    min-width: 100px;
    text-align: right;
    }
    .filter-item{
      margin-bottom: 0px;
    }
  }
</style>
